import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

import cn.edu.zju.om.nlp.PosTagger;
import cn.edu.zju.om.nlp.SUPosTaggerAdapter;
import cn.edu.zju.om.nlp.TaggedWord;

public class TagDemo {

	/**
	 * @param args
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {

		List<String> setence = new ArrayList<String>();

		BufferedReader reader = new BufferedReader(new InputStreamReader(
				System.in));
		
		while (true) {


			String input = reader.readLine();
			
			System.out.println(input);

			String[] words = input.split(" ");

			for (String word : words) {
				setence.add(word);
			}

			PosTagger tagger = new SUPosTaggerAdapter();
			List<TaggedWord> result = tagger.tagWordList(setence);

			for (TaggedWord taggedWord : result) {
				System.out.print(taggedWord.getWord() + " : "
						+ taggedWord.getTag() + " ");
			}
			System.out.println();

			setence.clear();
		}

	}

}
